{echo:JS::import('dialog?skin=brief');}
{echo:JS::import('dialogtools');}
{echo:JS::import('form');}
<form action="" method="post">
<div class="tools_bar clearfix">
    <a class="icon-checkbox-checked icon-checkbox-unchecked" href="javascript:;" onclick="tools_select('id[]',this)" title="全选" data="true"> 全选 </a>
    <!-- <a  class="icon-remove-2" href="javascript:;" onclick="tools_submit({action:'{url:/customer/customer_del}',msg:'删除后无法恢复，你真的删除吗？'})" title="删除"> 删除</a> -->
    <a class="icon-delicious" href="{url:/customer/seller_list}"> 全部商家</a>
    <span class="fr"><a href='javascript:;' id="condition" class="icon-search" style="" > 筛选条件</a><input id="condition_input" type="hidden" name="condition" value="{$condition}"></span>
</div>
<table class="default" >
    <tr>
        <th>&nbsp;&nbsp;用户名</th>
        <th>个人详情</th>
        <th>所属商品列表</th>
        <th>所属订单</th>
        <th>真实姓名</th>
        <th>销售总业绩</th>
        <th>订单总数</th>
        <th>商品种类</th>
        <th>开通时间</th>
    </tr>
    
    {query:name=seller as c,user as u fields=c.*,u.* where=c.seller_id eq u.id and $where id=$obj page=1 desc}
        <tr>
        	<td>&nbsp;&nbsp;<a target="_blank" href="{url:/customer/customer_list}&condition=and--name--eq--{$item['name']}">{$item['name']}</a></td>
        	<td><a target="_blank" href="{url:/customer/customer_list}&condition=and--name--eq--{$item['name']}">查看</a></td>
        	<td>
        		<a target="_blank" href="{url:/goods/goods_seller_list}&condition=and--seller_id--eq--{$item['id']}">查看</a>
        	</td>
        	<td>
        		<a target="_blank" href="{url:/order/order_seller_list}&condition=and--seller_id--eq--{$item['id']}">查看</a>
        	</td>
        	<td>
        		{echo:Common::get_user_obj($item['seller_id'])['real_name']}
        	</td>
        	<td></td>
        	<td>
        		待付款:<br>
        		待发货:
        	</td>
        	<td>
        		待审：<br>
        		在售:<br>
        		下架:
        	</td>
        	<td>{$item['create_time']}</td>
        </tr>
    {/query}
</table>
</form>
<div class="page_nav">
{echo:$obj->pageBar()}
</div>


<div id="balance_box" style="display: none;width:420px;padding: 5px;" class="box">
    <h2 class="page_title tc" style="border:none" id="balance-title">充值</h2>
    <div class="form2">
        <form  id="export_form" action="{url:/customer/balance_act}" method="post" callback="create_voucher">
          <input type="hidden" id="user_id" name="user_id" value="">
          <input type="hidden" id="type" name="type" value="">
          <dl class="lineD">
          <dt>金额：</dt>
          <dd><input id="amount" pattern="float" min="0.01"   name="amount" value=""> <label>最少金额为0.01</label></dd>
          </dl>
        <div class="tc mt10"><button class="button" id="balance-btn">充值</button></div>
        </form>
    </div>
</div>

<script type="text/javascript">
    function balance_op(user_id,type){
        $("#user_id").val(user_id);
        $("#type").val(type);
        var title = "充值";
        if(type==4) title = "退款";
        $("#balance-title").text(title);
        $("#balance-btn").text(title);
        $("#amount").val('');
        art.dialog({id:'balance_op',lock:true,opacity:0.1,title:title,width:400,height:200,padding:"15px",content:document.getElementById("balance_box")});
    }
    function create_voucher(e){
      if(e == null){
        var fields = $("#export_form").serializeArray();
        $.get("{url:/customer/balance_op}",fields,function(data){
          if(data['status']=='success'){
            art.dialog({id:'balance_op'}).close();
            art.dialog.tips("<p class='"+data['status']+"'>"+data['msg']+"</p>",2);
            setTimeout("tools_reload()",2000);
          }else{
            art.dialog.tips("<p class='"+data['status']+"'>"+data['msg']+"</p>");
          }
        },'json');
      }
      return false;
    }
</script>

<script type="text/javascript">
    var form =  new Form();
    $("#condition").on("click",function(){
    $("body").Condition({input:"#condition_input",okVal:'高级搜索',callback:function(data){tools_submit({action:'{url:/customer/customer_list}',method:'get'});},data:{'name':{name:'用户名'},real_name:{name:'真实姓名'},email:{name:'邮箱'},mobile:{name:'手机号码'},reg_time:{name:'注册时间'}
    }});
    });
</script>
